package com.lxq.springBoot.jedis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestJedis {

	@Autowired
	private JedisClient jedisClient;
	
	@GetMapping("get/jedis/{key}")
	@ResponseBody
	public ResponseEntity getJedis(@PathVariable("key") String key){
		String object = jedisClient.get(key);
		return new ResponseEntity(object, HttpStatus.OK);
	}
	
}
